package J20250330_real;

/**
 * Created with IntelliJ IDEA.
 * Description: 蜗牛——https://www.lanqiao.cn/problems/4985/learning/
 * User: 王圆豪
 * Date: 2025-04-04
 * Time: 20:22
 */
import java.util.*;
import java.math.*;
// 1:无需package
// 2: 类名必须Main, 不可修改

public class Main5 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] x = new int[n];
        for(int i = 0; i < n; i++) x[i] = scan.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        for(int i = 0; i < n-1; i++){
            a[i] = scan.nextInt();
            b[i+1] = scan.nextInt();
        }
        double[][] dp = new double[n][2];
        dp[0][0] = (double)x[0];
        dp[0][1] = (double)x[0] + a[0]/0.7;
        for(int i = 1; i < n; i++){
            dp[i][0] = Math.min(dp[i-1][0]+x[i]-x[i-1],dp[i-1][1] + b[i]/1.3);
            if(a[i] < b[i]){
                dp[i][1] = Math.min(dp[i-1][1]+(b[i]-a[i])/1.3, dp[i-1][0]+x[i]-x[i-1]+a[i]/0.7);
            }else{
                dp[i][1] = Math.min(dp[i-1][1]+(a[i]-b[i])/0.7, dp[i-1][0]+x[i]-x[i-1]+a[i]/0.7);
            }
        }
        double ret = new BigDecimal(dp[n-1][0]).setScale(2,RoundingMode.HALF_UP).doubleValue();
        System.out.printf("%.2f", ret);
        scan.close();
    }
}
